package com.apes.fico.masterdata.gl.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * @program: apestech
 * @description: 财务凭证类型
 * @author: Chengxm
 * @create: 2018-12-24 09:59
 **/
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = AccountingVoucherType.CONST_TABLE_NAME)
public class AccountingVoucherType extends Model {
    public final static String CONST_TABLE_NAME="mas_acc_voucher_type";
    @Id
    @Column(name = "id", length = 8)
    @Comment("凭证类型编码")
    @ApesGenerator(code = CONST_TABLE_NAME, name = "凭证类型")
    private String id;

    @Comment("凭证类型名称")
    @Column(name = "name", nullable = false, length = 64)
    private String name;

    @Comment("凭证类型描叙")
    @Column(name = "description", nullable = false, length = 255)
    private String description ;

    @Comment("凭证类型简称")
    @Column(name = "shortname", nullable = false, length = 255)
    private String shortname;

    @Comment("有效性")
    @Column(name = "valid", nullable = false, columnDefinition = "number(1,0) default 1")
    private boolean valid = true;
}
